package org.hbgl.geoentity.db.service;

import org.hbgl.geoentity.db.dao.DicAddressMapper;
import org.hbgl.geoentity.db.dao.DicTradeMapper;
import org.hbgl.geoentity.db.dao.DicUnitTypeMapper;
import org.hbgl.geoentity.db.domain.*;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 代码功能：
 * 开发日期：2022/5/13
 * 作者：蒋海仑
 * 联系方式：
 * 版本更迭说明：
 * 版权信息：河北广联信息技术有限公司
 */
@Service
public class DicService {
    @Resource
    private DicAddressMapper addressMapper;
    @Resource
    private DicUnitTypeMapper unitTypeMapper;
    @Resource
    private DicTradeMapper tradeMapper;

    public List<DicAddress> selectAddressAll() {
        DicAddressExample example = new DicAddressExample();
        example.or().andAddressNameNotLike("%（旧）");
        return addressMapper.selectByExample(example);
    }

    public List<DicUnitType> selectUnitTypeAll() {
        DicUnitTypeExample example = new DicUnitTypeExample();
        return unitTypeMapper.selectByExample(example);
    }

    public List<DicTrade> selectTradeAll() {
        DicTradeExample example = new DicTradeExample();
        example.or().andTradeLevelLessThanOrEqualTo(2);
        return tradeMapper.selectByExample(example);
    }
}
